<%@page import="Model.Purchase.PurchaseList"%>
<%@page import="RssEasy.Core.CookieHelper"%>
<%@page import="Model.My.PurchaseResultListView"%>
<%
    PurchaseResultListView pur = new PurchaseResultListView(pageContext);
    PurchaseList pu = new PurchaseList(pageContext);
    CookieHelper  cookie = new CookieHelper(request, response);
    pur.request();
    String shijian = pur.get("shijian");
    String enddt = pur.get("enddt");
    String stor = pur.get("stor");
    String myid ="";
    String level = cookie.Get("level");
    if(level.equals("0")){
     myid =cookie.Get("myid");
    }else{
     myid=cookie.Get("level");
    }
    if(shijian.equals("")){
      shijian="-1";
    }
    if(enddt.equals("")){
        enddt="9999999999";
    }
    if(stor.equals("1")){
     pur.select("count(*) as num").where("purchase_class="+pur.get("purchase_class")+" and typid= 2 and myid= "+myid+" and shijian >="+shijian +" and enddt <= "+enddt+"").get_first_rows();
     pur.write("num");  
    }
     if(stor.equals("2")){
     pu.select("count(*) as num").where("purchase_class="+pur.get("purchase_class")+" and typid= 2 and myid= "+myid+" and shijian >="+shijian +" and enddt <= "+enddt+"").get_first_rows();
      pu.write("num");
     }
   
%>